home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 001 / pibt3sp2.arc / PIBDWLOD.PAS < prev    next >
Pascal/Delphi Source File  |  1985-10-04  |  8KB  |  106 lines

  1. (*----------------------------------------------------------------------*)
  2. (*      PibDownLoad.Pas --- File Download Routines for PibTerm          *)
  3. (*----------------------------------------------------------------------*)
  4. (*                                                                      *)
  5. (*  Author:  Philip R. Burns                                            *)
  6. (*           Copyright (c) October, 1985.                               *)
  7. (*                                                                      *)
  8. (*  Version: 1.0   (January, 1985)                                      *)
  9. (*           2.0   (July, 1985)                                         *)
  10. (*           3.0   (October, 1985)                                      *)
  11. (*                                                                      *)
  12. (*  Systems: For MS-DOS on IBM PCs and close compatibles only.          *)
  13. (*           Note:  I have checked these on Zenith 151s under           *)
  14. (*                  MSDOS 2.1 and IBM PCs under PCDOS 2.0.              *)
  15. (*                                                                      *)
  16. (*  Needs:   The Menu routines from MENUS.PAS, the communications       *)
  17. (*           routines from ASYNC.PAS, and some global variables from    *)
  18. (*           PIBTERM.PAS.                                               *)
  19. (*                                                                      *)
  20. (*  History: Original with me, but the XMODEM is based upon the         *)
  21. (*           famous (X)MODEM(7) programs of Christiansen, et. al.       *)
  22. (*           Note that both the Checksum and CRC versions of XMODEM     *)
  23. (*           are available here.                                        *)
  24. (*                                                                      *)
  25. (*           Version 2.0 added the TELINK, MODEM7, & YMODEM protocols,  *)
  26. (*           as well as autodownloads from Bob Mahoney's Exec PC BBS.   *)
  27. (*                                                                      *)
  28. (*           Version 3.0 added Kermit.  Parts of the Kermit code were   *)
  29. (*           adapted from a CP/M version by Jeff Duncan.                *)
  30. (*                                                                      *)
  31. (*           Suggestions for improvements or corrections are welcome.   *)
  32. (*           Please leave messages on Gene Plantz's BBS (312) 882 4145  *)
  33. (*           or Ron Fox's BBS (312) 940 6496.                           *)
  34. (*                                                                      *)
  35. (*           If you use this code in your own programs, please be nice  *)
  36. (*           and give proper credit.                                    *)
  37. (*                                                                      *)
  38. (*----------------------------------------------------------------------*)
  39. (*                                                                      *)
  40. (*                            Restriction                               *)
  41. (*                            -----------                               *)
  42. (*                                                                      *)
  43. (*           You may use this code only for NON COMMERCIAL purposes     *)
  44. (*           unless you explicitly obtain my permission.  I take a dim  *)
  45. (*           view of others making money on my work and those of other  *)
  46. (*           people whose code I've inserted here.                      *)
  47. (*                                                                      *)
  48. (*----------------------------------------------------------------------*)
  49. (*                                                                      *)
  50. (*  Routines:                                                           *)
  51. (*                                                                      *)
  52. (*     PibDownLoad --- Main control routine                             *)
  53. (*                                                                      *)
  54. (*     Receive_Ascii_File --- Receive Ascii file from another computer  *)
  55. (*     Receive_Xmodem_File --- Receive file with XMODEM family          *)
  56. (*     Receive_Modem7_File --- Batch file download with MODEM7, TELINK  *)
  57. (*     Receive_Kermit_File --- Receive file with Kermit (stub only)     *)
  58. (*     Get_Download_Protocol --- Determines type of transfer            *)
  59. (*                                                                      *)
  60. (*----------------------------------------------------------------------*)
  61.  
  62. (*----------------------------------------------------------------------*)
  63. (*             PibDownLoad --- Control routine for downloads            *)
  64. (*----------------------------------------------------------------------*)
  65.  
  66. OVERLAY PROCEDURE  PibDownLoad( Transfer_Protocol : Transfer_Type );
  67.  
  68. (*----------------------------------------------------------------------*)
  69. (*                                                                      *)
  70. (*     Procedure:  PibDownload                                          *)
  71. (*                                                                      *)
  72. (*     Purpose:    Controls downloading of files from remote hosts.     *)
  73. (*                                                                      *)
  74. (*     Calling Sequence:                                                *)
  75. (*                                                                      *)
  76. (*        PibDownLoad( Transfer_Protocol : Transfer_Type );             *)
  77. (*                                                                      *)
  78. (*           Transfer_Protocol --- the type of transfer protocol        *)
  79. (*                                 be used; if None is given, then      *)
  80. (*                                 a prompt is issued for the transfer  *)
  81. (*                                 protocol.                            *)
  82. (*                                                                      *)
  83. (*     Remarks:                                                         *)
  84. (*                                                                      *)
  85. (*        Currently, the only available protocols are:                  *)
  86. (*                                                                      *)
  87. (*           Ascii file transfer (no error-correction)                  *)
  88. (*           Xmodem with Checksum                                       *)
  89. (*           Xmodem with CRC                                            *)
  90. (*           Ymodem                                                     *)
  91. (*           Ymodem batch                                               *)
  92. (*           Modem7 (Batch Xmodem)                                      *)
  93. (*           Telink                                                     *)
  94. (*           Kermit                                                     *)
  95. (*                                                                      *)
  96. (*      Calls:   Receive_Ascii_File                                     *)
  97. (*               Receive_Xmodem_File                                    *)
  98. (*               Receive_Kermit_File                                    *)
  99. (*               Receive_Modem7_File                                    *)
  100. (*               Get_Download_Protocol                                  *)
  101. (*                                                                      *)
  102. (*----------------------------------------------------------------------*)
  103.  
  104. VAR
  105.    OK_Init : BOOLEAN;
  106.    I       : INTEGER;